package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) RoleUpdate(ctx context.Context, req *system.RoleUpdateReq) (res *system.RoleUpdateRes, err error) {
	res = new(system.RoleUpdateRes)
	err = service.SystemRole().UpdateById(ctx, req.Id, model.SystemRoleUpdateInput{
		Name: req.Name,
		Code: req.Code,
	})
	return res, err
}
